package com.oocl.o2o.client.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.oocl.o2o.client.dao.CustomerDao;
import com.oocl.o2o.client.entity.Customer;
import com.oocl.o2o.client.service.CustomerService;

/**
 * @description: 
 * @author  XIEMI2
 * @date Aug 12, 2017 3:54:10 PM
 * @version 1.0
 */
@Service
public class CustomerServiceImpl implements CustomerService{

	@Resource
	private CustomerDao customerDao;
	
	@Override
	public List<Customer> findAll() {
		return customerDao.findAll();
	}

	@Transactional
	@Override
	public Customer add(Customer customer) {
		return customerDao.add(customer);
	}

	@Transactional
	@Override
	public Customer delete(String customerId) {
		return customerDao.delete(customerId);
	}

	@Transactional
	@Override
	public Customer update(Customer customer) {
		return customerDao.update(customer);
	}

	@Override
	public Customer findById(String customerId) {
		return customerDao.findByCustomerId(customerId);
	}

	@Override
	public Customer findByCustomerName(String customerName) {
		return customerDao.findByCustomerName(customerName);
	}

	@Override
	public Customer findByCustomerId(String customerId) {
		return customerDao.findByCustomerId(customerId);
	}

	@Override
	public Customer findByCustomerNameAndPassword(String merchantName, String password) {
		return customerDao.findByCustomerNameAndPassword(merchantName, password);
	}

	

}


